/*******************************************************************************

  Paying Outsourced Labor: Direct Evidence from Linked Temp Agency-Worker-Client Data

  By Andres Drenik, Simon Jäger, Pascuel Plotkin and Benjamin Schoefer
	January 7th, 2021

	DESCRIPTION: Creates Minimum Wage Threshold Dataset

*******************************************************************************/

/********************************************************************************
***** Preliminaries
********************************************************************************/
set more off
cap log close
local curr_date = c(current_date)
log using "${logs}/04_Wage_threshold`curr_date'", replace

/********************************************************************************
***** Run Do
********************************************************************************/
*This is a series of the Federal minimum wage. It can be donwladed from (http://www.trabajo.gob.ar/estadisticas/Bel/ingresos.asp)
use "${input}/MW.dta", clear

*Source: "Filling the gap in Argentina’s Inflation Data", Cavallo & Bertolotto (2016). You can find it in (http://www.thebillionpricesproject.com/our-research/) 
merge 1:1 date using "${input}/ArgentinaPriceLevel", nogen

gen months_since_2008 = date - tm(2008m1)

summ MW if year == 2008, mean

*Update MW using the average growth for the sample
*Generate the update factor
local update_factor = (1 + 0.015)^(1/12)

*Update each periods minimum using the update factor and the relative distance to January 2008
gen mw_threshold = `r(mean)'*`update_factor'^(months_since_2008)

drop if year < 2008

save "${intermediate_data_clea}\WageThreshold.dta", replace

log close
